package com.huangkailong.designpattern.flyweight;

/**
 * 享元模式测试.
 *
 * @author huangkl
 * @since 1.0.0
 */
public class Client {
    /**
     * main.
     */
    public static void main(String[] args) {
        ITicket ticket1 = TicketFactory.queryTicket("武汉", "成都");
        ticket1.showInfo("硬座");
        ticket1.showInfo("硬卧");
        ITicket ticket2 = TicketFactory.queryTicket("武汉", "北京");
        ticket2.showInfo("硬卧");
        System.out.println(
            TicketFactory.queryTicket("武汉", "成都") == TicketFactory.queryTicket("武汉", "成都"));
    }
}
